﻿using Pb;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EginDN
{

    private static EginDN _instance;
    public static EginDN Instance
    {
        get
        {
            if (_instance == null)
            {
                _instance = new EginDN();
            }
            return _instance;
        }
    }
    public int baseScore;
    public int createrUid;
    public int roomId;
    public int totalRound;
    public int seatId;
    public int currentRound;
    public ROOM_STATUS roomStatus;
    public Nn100ChipInfo chipInfo;
    public GameUserInfo bankerInfo;
    public int bankerSid { get; set; }
    public List<GameUserInfo> chairUserList;
    public int MaxBankerMultiple;
    public int MaxPlayerMultiple;
    public List<int> SeatList = new List<int>();
    public bool isBanker;


    public bool isReconnect = false;

    #region 其他玩家相对自己的seatid


    public void SortSeatId()
    {

        Debug.Log(seatId);
        int DownSeatId = 0;

        int RightSeatId = 0;
        int UpRightSeatId = 0;
        int Up2RightSeatId = 0;

        int TopRightSeatId = 0;
        int TopMidSeatId = 0;
        int TopLeftSeatId = 0;

        int Up2LeftSeatId = 0;
        int UpLeftSeatId = 0;
        int LeftSeatId = 0;

        if (seatId == 1)
        {
            //DownSeatId = 1;
            //RightSeatId = 2;
            //UpRightSeatId = 3;
            //UpLeftSeatId = 4;
            //LeftSeatId = 5;
            DownSeatId = 1;

            RightSeatId = 2;
            UpRightSeatId = 3;
            Up2RightSeatId = 4;

            TopRightSeatId = 5;
            TopMidSeatId = 6;
            TopLeftSeatId = 7;

            Up2LeftSeatId = 8;
            UpLeftSeatId = 9;
            LeftSeatId = 10;
        }
        else if (seatId == 2)
        {
            //DownSeatId = 2;
            //RightSeatId = 3;
            //UpRightSeatId = 4;
            //UpLeftSeatId = 5;
            //LeftSeatId = 1;
            DownSeatId = 2;

            RightSeatId = 3;
            UpRightSeatId = 4;
            Up2RightSeatId = 5;

            TopRightSeatId = 6;
            TopMidSeatId = 7;
            TopLeftSeatId = 8;

            Up2LeftSeatId = 9;
            UpLeftSeatId = 10;
            LeftSeatId = 1;
        }
        else if (seatId == 3)
        {
            //DownSeatId = 3;
            //RightSeatId = 4;
            //UpRightSeatId = 5;
            //UpLeftSeatId = 1;
            //LeftSeatId = 2;
            DownSeatId = 3;

            RightSeatId = 4;
            UpRightSeatId = 5;
            Up2RightSeatId = 6;

            TopRightSeatId = 7;
            TopMidSeatId = 8;
            TopLeftSeatId = 9;

            Up2LeftSeatId = 10;
            UpLeftSeatId = 1;
            LeftSeatId = 2;
        }
        else if (seatId == 4)
        {
            //DownSeatId = 4;
            //RightSeatId = 5;
            //UpRightSeatId = 1;
            //UpLeftSeatId = 2;
            //LeftSeatId = 3;
            DownSeatId = 4;

            RightSeatId = 5;
            UpRightSeatId = 6;
            Up2RightSeatId = 7;

            TopRightSeatId = 8;
            TopMidSeatId = 9;
            TopLeftSeatId = 10;

            Up2LeftSeatId = 1;
            UpLeftSeatId = 2;
            LeftSeatId = 3;
        }
        else if (seatId == 5)
        {
            //DownSeatId = 5;
            //RightSeatId = 1;
            //UpRightSeatId = 2;
            //UpLeftSeatId = 3;
            //LeftSeatId = 4;
            DownSeatId = 5;

            RightSeatId = 6;
            UpRightSeatId = 7;
            Up2RightSeatId = 8;

            TopRightSeatId = 9;
            TopMidSeatId = 10;
            TopLeftSeatId = 1;

            Up2LeftSeatId = 2;
            UpLeftSeatId = 3;
            LeftSeatId = 4;
        }
        else if (seatId == 6)
        {

            DownSeatId = 6;

            RightSeatId = 7;
            UpRightSeatId = 8;
            Up2RightSeatId = 9;

            TopRightSeatId = 10;
            TopMidSeatId = 1;
            TopLeftSeatId = 2;

            Up2LeftSeatId = 3;
            UpLeftSeatId = 4;
            LeftSeatId = 5;
        }
        else if (seatId == 7)
        {

            DownSeatId = 7;

            RightSeatId = 8;
            UpRightSeatId = 9;
            Up2RightSeatId = 10;

            TopRightSeatId = 1;
            TopMidSeatId = 2;
            TopLeftSeatId = 3;

            Up2LeftSeatId = 4;
            UpLeftSeatId = 5;
            LeftSeatId = 6;
        }
        else if (seatId == 8)
        {

            DownSeatId = 8;

            RightSeatId = 9;
            UpRightSeatId = 10;
            Up2RightSeatId = 1;

            TopRightSeatId = 2;
            TopMidSeatId = 3;
            TopLeftSeatId = 4;

            Up2LeftSeatId = 5;
            UpLeftSeatId = 6;
            LeftSeatId = 7;
        }
        else if (seatId == 9)
        {

            DownSeatId = 9;

            RightSeatId = 10;
            UpRightSeatId = 1;
            Up2RightSeatId = 2;

            TopRightSeatId = 3;
            TopMidSeatId = 4;
            TopLeftSeatId = 5;

            Up2LeftSeatId = 6;
            UpLeftSeatId = 7;
            LeftSeatId = 8;
        }
        else if (seatId == 10)
        {

            DownSeatId = 10;

            RightSeatId = 1;
            UpRightSeatId = 2;
            Up2RightSeatId = 3;

            TopRightSeatId = 4;
            TopMidSeatId = 5;
            TopLeftSeatId = 6;

            Up2LeftSeatId = 7;
            UpLeftSeatId = 8;
            LeftSeatId = 9;
        }
        SeatList.Clear();
        SeatList.Add(DownSeatId);

        SeatList.Add(RightSeatId);
        SeatList.Add(UpRightSeatId);
        SeatList.Add(Up2RightSeatId);

        SeatList.Add(TopRightSeatId);
        SeatList.Add(TopMidSeatId);
        SeatList.Add(TopLeftSeatId);

        SeatList.Add(Up2LeftSeatId);
        SeatList.Add(UpLeftSeatId);
        SeatList.Add(LeftSeatId);
    }

    public int returnOtherSeatIndex(int seatid)
    {
        int tempReture = 0;
        for (int i = 0; i < SeatList.Count; i++)
        {
            if (seatid == SeatList[i])
            {
                tempReture = i;
                break;
            }
        }
        return tempReture;
    }
    #endregion

    public NnReconnectRoomResponse nnReconnectRoomResponse;
    public Nn100ReconnectResponse nn100ReconnectResponse;
}
